<html>
<head><meta charset="utf-8"><title>question re PR · clippy · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/index.html">clippy</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/question.20re.20PR.html">question re PR</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="215208162"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/question%20re%20PR/near/215208162" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/question.20re.20PR.html#215208162">(Oct 31 2020 at 19:35)</a>:</h4>
<p>I have a PR (<a href="https://github.com/rust-lang/rust/issues/78343">#78343</a>) that makes <code>todo!</code>, <code>assert_eq!</code>, <code>unreachable!</code> etc. hygienic in the way they call <code>panic!</code>, but it's changing clippy output, causing bors tests to fail. Do you know why this is happening?</p>



<a name="215208322"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/question%20re%20PR/near/215208322" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/question.20re.20PR.html#215208322">(Oct 31 2020 at 19:39)</a>:</h4>
<p>Here's the CI results: <a href="https://github.com/rust-lang-ci/rust/runs/1335251169">https://github.com/rust-lang-ci/rust/runs/1335251169</a></p>



<a name="215208338"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/question%20re%20PR/near/215208338" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/question.20re.20PR.html#215208338">(Oct 31 2020 at 19:39)</a>:</h4>
<p>clippy hard-codes some paths IIRC</p>



<a name="215208394"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/question%20re%20PR/near/215208394" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/question.20re.20PR.html#215208394">(Oct 31 2020 at 19:40)</a>:</h4>
<p>So it's picking up on things that it couldn't figure out before?</p>



<a name="215208401"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/question%20re%20PR/near/215208401" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/question.20re.20PR.html#215208401">(Oct 31 2020 at 19:40)</a>:</h4>
<p>Here's an example of a change:</p>
<div class="codehilite" data-code-language="Diff"><pre><span></span><code><span class="gi">+error: sub-expression diverges</span>
<span class="gi">+  --&gt; $DIR/wildcard_enum_match_arm.rs:68:17</span>
<span class="gi">+   |</span>
<span class="gi">+LL |     let x: u8 = unimplemented!();</span>
<span class="gi">+   |                 ^^^^^^^^^^^^^^^^</span>
<span class="gi">+   |</span>
<span class="gi">+   = note: `-D clippy::diverging-sub-expression` implied by `-D warnings`</span>
<span class="gi">+   = note: this error originates in a macro (in Nightly builds, run with -Z macro-backtrace for more info)</span>
<span class="gi">+</span>
</code></pre></div>



<a name="215208415"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/question%20re%20PR/near/215208415" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/question.20re.20PR.html#215208415">(Oct 31 2020 at 19:41)</a>:</h4>
<p>seems reasonable to just --bless that, yeah</p>



<a name="215208420"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/question%20re%20PR/near/215208420" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/question.20re.20PR.html#215208420">(Oct 31 2020 at 19:41)</a>:</h4>
<p>but you might want feedback from a clippy team member</p>



<a name="215208478"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/question%20re%20PR/near/215208478" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/question.20re.20PR.html#215208478">(Oct 31 2020 at 19:42)</a>:</h4>
<p>This one's weird though:</p>
<div class="codehilite" data-code-language="Diff"><pre><span></span><code> error: `panic` should not be present in production code
   --&gt; $DIR/panicking_macros.rs:6:5
    |
 LL |     panic!();
    |     ^^^^^^^^^
    |
    = note: `-D clippy::panic` implied by `-D warnings`

 error: `panic` should not be present in production code
   --&gt; $DIR/panicking_macros.rs:7:5
    |
 LL |     panic!("message");
    |     ^^^^^^^^^^^^^^^^^^
    |
macro-backtrace for more info)

 error: `panic` should not be present in production code
   --&gt; $DIR/panicking_macros.rs:8:5
    |
 LL |     panic!("{} {}", "panic with", "multiple arguments");
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
macro-backtrace for more info)

<span class="gd">-error: `todo` should not be present in production code</span>
<span class="gd">-  --&gt; $DIR/panicking_macros.rs:14:5</span>
<span class="gd">-   |</span>
<span class="gd">-LL |     todo!();</span>
<span class="gd">-   |     ^^^^^^^^</span>
<span class="gd">-   |</span>
<span class="gd">-   = note: `-D clippy::todo` implied by `-D warnings`</span>
<span class="gd">-</span>
<span class="gd">-error: `todo` should not be present in production code</span>
<span class="gd">-  --&gt; $DIR/panicking_macros.rs:15:5</span>
<span class="gd">-   |</span>
<span class="gd">-LL |     todo!("message");</span>
<span class="gd">-   |     ^^^^^^^^^^^^^^^^^</span>
<span class="gd">-</span>
<span class="gd">-error: `todo` should not be present in production code</span>
<span class="gd">-  --&gt; $DIR/panicking_macros.rs:16:5</span>
<span class="gd">-   |</span>
<span class="gd">-LL |     todo!("{} {}", "panic with", "multiple arguments");</span>
<span class="gd">-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^</span>
<span class="gd">-</span>
<span class="gd">-error: `unimplemented` should not be present in production code</span>
<span class="gd">-  --&gt; $DIR/panicking_macros.rs:22:5</span>
<span class="gd">-   |</span>
<span class="gd">-LL |     unimplemented!();</span>
<span class="gd">-   |     ^^^^^^^^^^^^^^^^^</span>
<span class="gd">-   |</span>
<span class="gd">-   = note: `-D clippy::unimplemented` implied by `-D warnings`</span>
<span class="gd">-</span>
<span class="gd">-error: `unimplemented` should not be present in production code</span>
<span class="gd">-  --&gt; $DIR/panicking_macros.rs:23:5</span>
<span class="gd">-   |</span>
<span class="gd">-LL |     unimplemented!("message");</span>
<span class="gd">-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^</span>
<span class="gd">-</span>
<span class="gd">-error: `unimplemented` should not be present in production code</span>
<span class="gd">-  --&gt; $DIR/panicking_macros.rs:24:5</span>
<span class="gd">-   |</span>
<span class="gd">-LL |     unimplemented!("{} {}", "panic with", "multiple arguments");</span>
<span class="gd">-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^</span>
<span class="gd">-</span>
<span class="gd">-error: `unreachable` should not be present in production code</span>
<span class="gd">-  --&gt; $DIR/panicking_macros.rs:30:5</span>
<span class="gd">-   |</span>
<span class="gd">-LL |     unreachable!();</span>
<span class="gd">-   |     ^^^^^^^^^^^^^^^</span>
<span class="gd">-   |</span>
<span class="gd">-   = note: `-D clippy::unreachable` implied by `-D warnings`</span>
<span class="gd">-</span>
<span class="gd">-error: `unreachable` should not be present in production code</span>
<span class="gd">-  --&gt; $DIR/panicking_macros.rs:31:5</span>
<span class="gd">-   |</span>
<span class="gd">-LL |     unreachable!("message");</span>
<span class="gd">-   |     ^^^^^^^^^^^^^^^^^^^^^^^^</span>
<span class="gd">-   |</span>
macro-backtrace for more info)
<span class="gd">-</span>
<span class="gd">-error: `unreachable` should not be present in production code</span>
<span class="gd">-  --&gt; $DIR/panicking_macros.rs:32:5</span>
<span class="gd">-   |</span>
<span class="gd">-LL |     unreachable!("{} {}", "panic with", "multiple arguments");</span>
<span class="gd">-   |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^</span>
<span class="gd">-</span>
<span class="gd">-error: aborting due to 12 previous errors</span>
<span class="gi">+error: aborting due to 3 previous errors</span>
</code></pre></div>



<a name="215208483"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/question%20re%20PR/near/215208483" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/question.20re.20PR.html#215208483">(Oct 31 2020 at 19:42)</a>:</h4>
<p>It's somehow <em>losing</em> information</p>



<a name="215208485"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/question%20re%20PR/near/215208485" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/question.20re.20PR.html#215208485">(Oct 31 2020 at 19:42)</a>:</h4>
<p>I have no idea what could be causing it</p>



<a name="215208565"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/question%20re%20PR/near/215208565" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/question.20re.20PR.html#215208565">(Oct 31 2020 at 19:45)</a>:</h4>
<p>looks like they specifically checked for them to expand to <em>std</em>'s panic. but they expand to core's panic now.</p>



<a name="215208573"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/question%20re%20PR/near/215208573" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/question.20re.20PR.html#215208573">(Oct 31 2020 at 19:45)</a>:</h4>
<p>see <code>clippy_lints/src/panic_unimplemented.rs</code> on line 99 and 100</p>



<a name="215208622"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/question%20re%20PR/near/215208622" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/question.20re.20PR.html#215208622">(Oct 31 2020 at 19:46)</a>:</h4>
<p>Ah, okay. I'll check that out. Thanks!</p>



<a name="215208658"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/question%20re%20PR/near/215208658" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/question.20re.20PR.html#215208658">(Oct 31 2020 at 19:47)</a>:</h4>
<p>I think the policy is to edit the subtree/submodule/whatever it is, right?</p>



<a name="215208714"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/question%20re%20PR/near/215208714" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> flip1995 <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/question.20re.20PR.html#215208714">(Oct 31 2020 at 19:48)</a>:</h4>
<p>The diverging sub expression thing is a bug and shouldn't trigger</p>



<a name="215208717"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/question%20re%20PR/near/215208717" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/question.20re.20PR.html#215208717">(Oct 31 2020 at 19:48)</a>:</h4>
<p>that mentions <code>path::BEGIN_PANIC</code> and <code>path::BEGIN_PANIC_FMT</code>, which are defined as <code>std::panicking::begin_panic</code> and <code>std::panicking::begin_panic_fmt</code>. but now those macros end up using <code>core::panicking::panic</code> or <code>core::panicking::panic_fmt</code> (or <code>core::panicking::panic_str</code>, maybe).</p>



<a name="215208802"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/question%20re%20PR/near/215208802" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> flip1995 <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/question.20re.20PR.html#215208802">(Oct 31 2020 at 19:50)</a>:</h4>
<blockquote>
<p>I think the policy is to edit the subtree/submodule/whatever it is, right?</p>
</blockquote>
<p>Yes, please fix it directly in <code>src/tools/clippy</code> we'll sync it back later. No test outputs of clippy should change in your PR.</p>



<a name="215208822"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/question%20re%20PR/near/215208822" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> flip1995 <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/question.20re.20PR.html#215208822">(Oct 31 2020 at 19:51)</a>:</h4>
<p>You can ping me for review of the clippy changes.</p>



<a name="215208901"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/question%20re%20PR/near/215208901" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/question.20re.20PR.html#215208901">(Oct 31 2020 at 19:52)</a>:</h4>
<p>Okay, thanks! I'll ping you when I have a commit up</p>



<a name="215208918"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/question%20re%20PR/near/215208918" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/question.20re.20PR.html#215208918">(Oct 31 2020 at 19:53)</a>:</h4>
<p>just searching for all occurences of BEGIN_PANIC in clippy should point out all the cases where it tries to detect panic, but now fails because it doesn't detect core's panic.</p>



<a name="215209190"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/question%20re%20PR/near/215209190" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> flip1995 <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/question.20re.20PR.html#215209190">(Oct 31 2020 at 19:59)</a>:</h4>
<p>Just changing/updating the path in <code>clippy_lints/src/utils/paths.rs</code> should fix most of the problems already.</p>



<a name="215209251"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/question%20re%20PR/near/215209251" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/question.20re.20PR.html#215209251">(Oct 31 2020 at 20:00)</a>:</h4>
<p>then detecting <code>panic!()</code> won't work anymore. that still uses std::panicking::*</p>



<a name="215209307"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/question%20re%20PR/near/215209307" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/question.20re.20PR.html#215209307">(Oct 31 2020 at 20:01)</a>:</h4>
<p>only assert_eq, assert_ne, unimplemented, todo, and unreachable are changed to use core::panic.</p>



<a name="215209461"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/question%20re%20PR/near/215209461" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/question.20re.20PR.html#215209461">(Oct 31 2020 at 20:04)</a>:</h4>
<p>probably good to put this in a separate PR. because it seems to fix the already existing bug that clippy doesn't detect panics in no_std programs</p>



<a name="215209677"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/question%20re%20PR/near/215209677" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/question.20re.20PR.html#215209677">(Oct 31 2020 at 20:09)</a>:</h4>
<p>oh, the addition of <code>std::panicking::panic_any</code> was merged just half an hour ago. it should probably detect that one as well.</p>



<a name="215209744"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/question%20re%20PR/near/215209744" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/question.20re.20PR.html#215209744">(Oct 31 2020 at 20:10)</a>:</h4>
<p>so then there's now six functions that indicate a panic:</p>
<ul>
<li><code>std::panicking::begin_panic</code></li>
<li><code>std::panicking::begin_panic_fmt</code></li>
<li><code>std::panicking::panic_any</code></li>
<li><code>core::panicking::panic</code></li>
<li><code>core::panicking::panic_str</code></li>
<li><code>core::panicking::panic_fmt</code></li>
</ul>



<a name="215209790"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/question%20re%20PR/near/215209790" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/question.20re.20PR.html#215209790">(Oct 31 2020 at 20:12)</a>:</h4>
<p>Don't forget these!</p>
<ul>
<li><code>std::rt::begin_panic</code></li>
<li><code>std::rt::begin_panic_fmt</code></li>
</ul>



<a name="215209827"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/question%20re%20PR/near/215209827" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/question.20re.20PR.html#215209827">(Oct 31 2020 at 20:12)</a>:</h4>
<p>So how should I fix this?</p>



<a name="215209835"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/question%20re%20PR/near/215209835" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/question.20re.20PR.html#215209835">(Oct 31 2020 at 20:12)</a>:</h4>
<p>those are just aliases for the first two, right?</p>



<a name="215209847"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/question%20re%20PR/near/215209847" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/question.20re.20PR.html#215209847">(Oct 31 2020 at 20:12)</a>:</h4>
<p>Not sure <span aria-label="shrug" class="emoji emoji-1f937" role="img" title="shrug">:shrug:</span></p>



<a name="215209856"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/question%20re%20PR/near/215209856" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/question.20re.20PR.html#215209856">(Oct 31 2020 at 20:12)</a>:</h4>
<p>yeah, they are</p>



<a name="215209861"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/question%20re%20PR/near/215209861" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/question.20re.20PR.html#215209861">(Oct 31 2020 at 20:13)</a>:</h4>
<p>This change is so much more involved than I thought</p>



<a name="215209879"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/question%20re%20PR/near/215209879" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/question.20re.20PR.html#215209879">(Oct 31 2020 at 20:13)</a>:</h4>
<p>check all places where it compares against BEGIN_PANIC or BEGIN_PANIC_FMT, and replace it with a check for all six functions. probably good to make one 'is_panic' function instead of repeating it</p>



<a name="215209882"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/question%20re%20PR/near/215209882" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/question.20re.20PR.html#215209882">(Oct 31 2020 at 20:13)</a>:</h4>
<p>Although I guess I say that about a bunch of PRs I've made <span aria-label="shrug" class="emoji emoji-1f937" role="img" title="shrug">:shrug:</span></p>



<a name="215209941"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/question%20re%20PR/near/215209941" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/question.20re.20PR.html#215209941">(Oct 31 2020 at 20:14)</a>:</h4>
<p>thanks for working on this :)  but if you want, i can also fix this part. you've already put so much effort into this change :)</p>



<a name="215210008"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/question%20re%20PR/near/215210008" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/question.20re.20PR.html#215210008">(Oct 31 2020 at 20:16)</a>:</h4>
<p>Well, I think I'll try to fix this part myself. But if there are more issues I might hand it over to you <span aria-label="laughing" class="emoji emoji-1f606" role="img" title="laughing">:laughing:</span></p>



<a name="215210040"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/question%20re%20PR/near/215210040" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/question.20re.20PR.html#215210040">(Oct 31 2020 at 20:16)</a>:</h4>
<p>sure :)  ping me if i can help with anything.</p>



<a name="215224525"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/question%20re%20PR/near/215224525" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/question.20re.20PR.html#215224525">(Nov 01 2020 at 03:25)</a>:</h4>
<p>This is actually trickier than I thought: There are things like</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="k">if</span><span class="w"> </span><span class="kd">let</span><span class="w"> </span><span class="nb">Some</span><span class="p">(</span><span class="n">args</span><span class="p">)</span><span class="w"> </span><span class="o">=</span><span class="w"> </span><span class="n">match_function_call</span><span class="p">(</span><span class="n">cx</span><span class="p">,</span><span class="w"> </span><span class="n">begin_panic_call</span><span class="p">,</span><span class="w"> </span><span class="o">&amp;</span><span class="n">paths</span>::<span class="n">BEGIN_PANIC</span><span class="p">);</span><span class="w"></span>
</code></pre></div>
<p>which I'm not sure how to update.</p>



<a name="215224527"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/question%20re%20PR/near/215224527" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/question.20re.20PR.html#215224527">(Nov 01 2020 at 03:25)</a>:</h4>
<p>Any ideas?</p>



<a name="215238273"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/question%20re%20PR/near/215238273" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/question.20re.20PR.html#215238273">(Nov 01 2020 at 10:43)</a>:</h4>
<p><span class="user-mention" data-user-id="307537">@Camelid</span>  I guess this would work?</p>
<div class="codehilite" data-code-language="Rust"><pre><span></span><code><span class="n">match_function_call</span><span class="p">(</span><span class="n">cx</span><span class="p">,</span><span class="w"> </span><span class="n">begin_panic_call</span><span class="p">,</span><span class="w"> </span><span class="o">&amp;</span><span class="n">paths</span>::<span class="n">BEGIN_PANIC</span><span class="p">)</span><span class="w"></span>
<span class="w">    </span><span class="p">.</span><span class="n">or_else</span><span class="p">(</span><span class="o">||</span><span class="w"> </span><span class="n">match_function_call</span><span class="p">(</span><span class="n">cx</span><span class="p">,</span><span class="w"> </span><span class="n">begin_panic_call</span><span class="p">,</span><span class="w"> </span><span class="o">&amp;</span><span class="n">paths</span>::<span class="n">BEGIN_PANIC_FMT</span><span class="p">))</span><span class="w"></span>
<span class="w">    </span><span class="p">.</span><span class="n">or_else</span><span class="p">(</span><span class="o">||</span><span class="w"> </span><span class="n">match_function_call</span><span class="p">(</span><span class="n">cx</span><span class="p">,</span><span class="w"> </span><span class="n">begin_panic_call</span><span class="p">,</span><span class="w"> </span><span class="o">&amp;</span><span class="n">paths</span>::<span class="n">PANIC_ANY</span><span class="p">))</span><span class="w"></span>
<span class="w">    </span><span class="p">.</span><span class="n">or_else</span><span class="p">(</span><span class="o">||</span><span class="w"> </span><span class="n">match_function_call</span><span class="p">(</span><span class="n">cx</span><span class="p">,</span><span class="w"> </span><span class="n">begin_panic_call</span><span class="p">,</span><span class="w"> </span><span class="o">&amp;</span><span class="n">paths</span>::<span class="n">PANIC</span><span class="p">))</span><span class="w"> </span><span class="n">etc</span><span class="p">.</span><span class="w"></span>
</code></pre></div>



<a name="215255644"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/question%20re%20PR/near/215255644" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/question.20re.20PR.html#215255644">(Nov 01 2020 at 18:25)</a>:</h4>
<p>I guess I'll create another utility function for what you posted.</p>



<a name="215256883"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/question%20re%20PR/near/215256883" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/question.20re.20PR.html#215256883">(Nov 01 2020 at 18:55)</a>:</h4>
<p>i suppose with an <code>.is_ok()</code> it can also work as a <code>is_panic</code> function</p>



<a name="215257909"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/question%20re%20PR/near/215257909" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/question.20re.20PR.html#215257909">(Nov 01 2020 at 19:20)</a>:</h4>
<p>Good idea, thanks :)</p>



<a name="216028240"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/257328-clippy/topic/question%20re%20PR/near/216028240" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Mara <a href="https://rust-lang.github.io/zulip_archive/stream/257328-clippy/topic/question.20re.20PR.html#216028240">(Nov 08 2020 at 22:19)</a>:</h4>
<p><span class="user-mention" data-user-id="307537">@Camelid</span> thanks for getting this fixed quickly :)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>